var table = null;
$(function(){
	table = $('.datatable').DataTable({
		serverSide: true,
		ajax: {
			url:url,
			data:data
		},
		processing: true,
		filter: false,
        sort: false,
        autoWidth: false,
		destroy:true,		
		dom: "<'row-fluid'<'col-md-6'><'col-md-6'f>r>t<'row-fluid'<'col-md-3'l><'col-md-3'i><'col-md-6 center'p>>",
		pagingType: 'full_numbers',
		columns: columns(),
	    language: language,
	    createdRow: function (row, data, index) {
	        $(row).click(function () {
	        	$(this).toggleClass('row_selected info').siblings().removeClass('row_selected info');
	        });
	    }
	});	
});

var language = {
    	"processing" : "正在加载中......",
        "lengthMenu" : "每页显示 _MENU_ 条记录",
        "zeroRecords" : "没有可以显示的记录",
        "emptyTable" : "表中无数据存在！",
        "info" : "当前显示 _START_ 到 _END_ 条，共 _TOTAL_ 条记录",
        "infoEmpty" : "显示0到0条记录",
        "infoFiltered" : "数据表中共为 _MAX_ 条记录",
        "search" : "搜索",
        "paginate" : {
            "first" : "首页",
            "previous" : "上一页",
            "next" : "下一页",
            "last" : "末页"
        }
};